home *** CD-ROM | disk | FTP | other *** search
- Path: hursley.ibm.com!news
- From: Max Waterman <dwater@wight.hursley.ibm.com>
- Newsgroups: comp.programming,comp.sys.sgi.misc,comp.lang.c
- Subject: Re: C pointer question.
- Date: Wed, 03 Apr 1996 12:48:43 +0100
- Organization: IBM UK Laboratories Ltd.
- Message-ID: <3162659B.6201@wight.hursley.ibm.com>
- References: <315BFDBB.773C@wight.hursley.ibm.com> <4jlhpl$i3c@hn.ocbbs.gen.nz> <31616BAF.5BAB@datalytics.com>
- NNTP-Posting-Host: wight.hursley.ibm.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.01 (X11; I; AIX 2)
-
- Rob Stewart wrote:
-
- If your reading news:comp.lang.c see news:comp.sys.sgi.misc for full
- thread.
- I should have posted it here to start with but didn't know it was here,
- sorry everyone else.....
-
- >[snip]
- > Putting them on separate lines is safer
- > and leaves room for a comment to the right explaining the
- > purpose of the variable.
-
- > > I usually don't declare my variables in this style but like ...
- > >
- > > char* name1;
- > > char name2;
- > > char name3;
- > >
- > > Less cluttered and easier (i feel) to read ... and that the goal isn't it.
- > > [snip]
-
- I personally agree - one line per variable - but for some reason the
- coding standards at a place I previously worked at forced us to put
- variables of the same type on one line. They were for PASCAL rather than
- C, but I can't think what the reasons would be for doing this -
- especially since coding standards generally favour readability.
-
- Ie what are the arguments for :
-
- char name1,
- name2,
- name3;
-
- over :
-
- char name1;
- char name2;
- char name3;
-
- ?
-
- Aren't they identical?
-
- Any compiler boffs out there know about this?
-
- --
- ___ mailto:max@lton.u-net.com
- / / / _ / / _ __ __ _ __ _
- / / / /_/ |/ / / / /_/ / /_ /_/ / / / /_/ /| /
- / / / / / /| /_/_/ / / / /_ / | / / / / / / |/
-